import request from '@/utils/request'

export default {
  list() {
    return request({
      url: '/admin/edu/teacher/list',
      method: 'get'
    })
  },
  pageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/teacher/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  // 3.删除数据
  removeById(id) {
    return request({
      url: `/admin/edu/teacher/deleteById/${id}`,
      method: 'delete'
    })
  },
  // 4.新增讲师
  save(teacher) {
    return request({
      url: 'admin/edu/teacher/save',
      method: 'post',
      data: teacher
    })
  },
  // 5.显示讲师信息
  getById(id) {
    return request({
      url: `/admin/edu/teacher/getById/${id}`,
      method: 'get'
    })
  },
  // 6.更新讲师
  updateById(teacher) {
    return request({
      url: '/admin/edu/teacher/updateById',
      method: 'put',
      data: teacher
    })
  },
  // 7.批量删除
  batchRemove(idList) {
    return request({
      url: '/admin/edu/teacher/batchDel',
      method: 'delete',
      data: idList
    })
  }
}
